package com.example.hospital.api.config;

import com.example.hospital.api.interceptors.ResponseResultInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

/**
 * ClassName: InterceptorRegisterConfig
 * Package: com.example.hospital.api.config
 * Description:
 *
 * @Author JJQ
 * @create 2024/7/29 0029 23:44
 * @Version 1.0
 */
@Configuration
public class InterceptorRegisterConfig implements WebMvcConfigurer {
    @Autowired
    ResponseResultInterceptor resultInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry){
        List<String> paths = new ArrayList<>();
        registry.addInterceptor(resultInterceptor).addPathPatterns("/**");
    }
}
